package com.eastfair.builder.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.builder.service.BuilderReportDrawingCategoryAuditHistoryService;
import com.eastfair.core.base.R;
import com.eastfair.core.exception.BizException;
import com.eastfair.home.api.ReportDrawingCategoryAuditHistoryFeign;
import com.eastfair.home.dto.ReportDrawingCategoryAuditHistoryDTO;
import com.eastfair.home.vo.ReportDrawingCategoryAuditHistoryVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 报馆图纸分类审核历史服务.
 *
 * @author dqq
 * @date 2022 /8/22
 */
@Slf4j
@Service
public class BuilderReportDrawingCategoryAuditHistoryServiceImpl implements BuilderReportDrawingCategoryAuditHistoryService {

    @Resource
    private ReportDrawingCategoryAuditHistoryFeign reportDrawingCategoryAuditHistoryFeign;

    @Override
    public Page<ReportDrawingCategoryAuditHistoryVO> queryReportDrawingCategoryAuditHistory(PageParams<ReportDrawingCategoryAuditHistoryDTO> pageParams) {
        R<Page<ReportDrawingCategoryAuditHistoryVO>> result = reportDrawingCategoryAuditHistoryFeign.queryReportDrawingCategoryAuditHistory(pageParams);
        if (!result.getIsSuccess()) {
            throw BizException.wrap(result.getCode(), result.getMsg());
        }
        return result.getData();
    }
}